
import { defineStore } from 'pinia'
import { ref } from 'vue'
import type {  DICT } from '@/types/login'


// 定义 Store
export const useDictStore = defineStore(
  'dict',
  () => {
    const dictList = ref<DICT[]>([
    ])
    const setDict = (dict: DICT[]) => {
      dictList.value = dict
    }

    const getDict = () => {
      return dictList.value
    }
    const clearDICT = () => {
      dictList.value = []
    }
    return {
      dictList,
      getDict,
      setDict,
      clearDICT,
    }
  },
  {
    persist: {
      storage: {
        getItem: (key) => uni.getStorageSync(key),
        setItem: (key, value) => uni.setStorageSync(key, value),
      },
    },
  }
)